package com.ruoyi.driver.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.driver.mapper.TbDriverTrainingMapper;
import com.ruoyi.driver.domain.TbDriverTraining;
import com.ruoyi.driver.service.ITbDriverTrainingService;

/**
 * 驾驶员培训课程信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-27
 */
@Service
public class TbDriverTrainingServiceImpl implements ITbDriverTrainingService 
{
    @Autowired
    private TbDriverTrainingMapper tbDriverTrainingMapper;

    /**
     * 查询驾驶员培训课程信息
     * 
     * @param driverTrainingId 驾驶员培训课程信息主键
     * @return 驾驶员培训课程信息
     */
    @Override
    public TbDriverTraining selectTbDriverTrainingByDriverTrainingId(Integer driverTrainingId)
    {
        return tbDriverTrainingMapper.selectTbDriverTrainingByDriverTrainingId(driverTrainingId);
    }

    /**
     * 查询驾驶员培训课程信息列表
     * 
     * @param tbDriverTraining 驾驶员培训课程信息
     * @return 驾驶员培训课程信息
     */
    @Override
    public List<TbDriverTraining> selectTbDriverTrainingList(TbDriverTraining tbDriverTraining)
    {
        return tbDriverTrainingMapper.selectTbDriverTrainingList(tbDriverTraining);
    }

    /**
     * 新增驾驶员培训课程信息
     * 
     * @param tbDriverTraining 驾驶员培训课程信息
     * @return 结果
     */
    @Override
    public int insertTbDriverTraining(TbDriverTraining tbDriverTraining)
    {
        tbDriverTraining.setCreateTime(DateUtils.getNowDate());
        return tbDriverTrainingMapper.insertTbDriverTraining(tbDriverTraining);
    }

    /**
     * 修改驾驶员培训课程信息
     * 
     * @param tbDriverTraining 驾驶员培训课程信息
     * @return 结果
     */
    @Override
    public int updateTbDriverTraining(TbDriverTraining tbDriverTraining)
    {
        tbDriverTraining.setUpdateTime(DateUtils.getNowDate());
        return tbDriverTrainingMapper.updateTbDriverTraining(tbDriverTraining);
    }

    /**
     * 批量删除驾驶员培训课程信息
     * 
     * @param driverTrainingIds 需要删除的驾驶员培训课程信息主键
     * @return 结果
     */
    @Override
    public int deleteTbDriverTrainingByDriverTrainingIds(Integer[] driverTrainingIds)
    {
        return tbDriverTrainingMapper.deleteTbDriverTrainingByDriverTrainingIds(driverTrainingIds);
    }

    /**
     * 删除驾驶员培训课程信息信息
     * 
     * @param driverTrainingId 驾驶员培训课程信息主键
     * @return 结果
     */
    @Override
    public int deleteTbDriverTrainingByDriverTrainingId(Integer driverTrainingId)
    {
        return tbDriverTrainingMapper.deleteTbDriverTrainingByDriverTrainingId(driverTrainingId);
    }
}
